<?php
$this->title = "增加会员组";
?>
<div class="main">
	<div class="header">增加会员组</div>
	<div class="form-container">
		<form id="group-form" class="form-horizontal" action="<?=ROOT_URL?>user/groupadd" method="post">
			<?php
			if($type == 'modify')
			{
				echo "<input name='id' type='hidden' value='".$group['id']."'>";
			}
			?>
			<div class="form-group">
				<label class="col-sm-4 control-label">会员组名称</label>
				<div class="col-sm-4">
					<input id="groupname" type="text" class="form-control" name="name" <?php if($type == 'modify') echo "value='".$group['name']."'"?>>
				</div>
			</div>
			
		 	<div class="form-group">
				<label class="col-sm-4 control-label"></label>
				<div class="col-sm-4">
					<input id="submitbtn" type="button" class="btn btn-primary col-sm-4" value="确定" style="margin-right:40px">
					<a href="<?=ROOT_URL?>user/group" class="btn btn-danger col-sm-4">返回</a>
				</div>
			</div> 
		</form>
	</div>
<div>
<script type="text/javascript">
$("#submitbtn").click(function(){
	if($.trim($("#groupname").val()) == "")
	{
		alert("请输入会员组名称");
	}else
	{
		$("#group-form").submit();
	}
	
});

</script>
